package com.ncloud.act.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.ncloud.act.entity.ChnlWriteOffLog;

@Mapper
public interface ChnlWriteOffLogMapper{

	@Select("SELECT writeoff_id, charge_id, chnl_id, bill_id, fee, writeoff_fee, old_balance, new_balance, old_paytag, new_paytag, operate_time "
			+ "operate_user_id, cancel_tag, remark FROM sys_chnl_writeofflog where chnl_id =#{chnl_id} ")
	@Results({
		@Result(column="writeoff_id",property="writeoff_id"),@Result(column="charge_id",property="charge_id"),
		@Result(column="chnl_id",property="chnl_id"),@Result(column="bill_id",property="bill_id"),
		@Result(column="fee",property="fee"),@Result(column="writeoff_fee",property="writeoff_fee"),
		@Result(column="old_balance",property="old_balance"),@Result(column="new_balance",property="new_balance"),
		@Result(column="old_paytag",property="old_paytag"),@Result(column="new_paytag",property="new_paytag"),
		@Result(column="operate_time",property="operate_time"),@Result(column="operate_user_id",property="operate_user_id"),
		@Result(column="cancel_tag",property="cancel_tag"),@Result(column="remark",property="remark")})
	List<ChnlWriteOffLog> getChnlWriteOffLogByChnlID(Long chnl_id);
	
	@Insert(value = "INSERT INTO sys_chnl_writeofflog (writeoff_id, charge_id, chnl_id, bill_id, fee, writeoff_fee, old_balance, new_balance, old_paytag, new_paytag, operate_time, operate_user_id, cancel_tag, remark) "
										+ "values(#{writeoff_id},#{charge_id},#{chnl_id},#{bill_id},#{fee},#{writeoff_fee},#{old_balance},#{new_balance},#{old_paytag},#{new_paytag},#{operate_time},#{operate_user_id},#{cancel_tag},#{remark})")
    public int insertChnlWriteOffLog(ChnlWriteOffLog chnlWriteOffLog);
	
	/*@Update(value = "UPDATE sys_chnl_paylog SET deposit_money = #{deposit_money},update_time = #{update_time}, update_user_id = #{update_user_id} WHERE chnl_id = #{chnl_id} ")
    public int updateChnlPayLog(ChnlPayLog chnlPayLog);*/
}
